Repository navigation
[1403] 统一扩展加载机制:define-library (gfcode ...) 导出 extension 工厂 - #32
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactor extension loading to a single library-based protocol, modeled on pi's TS extension loader (
jiti.import→ default-export factory →factory(api)).Protocol (single path, no legacy fallback)
Layout
.gf/gfcode/~/.gf/gfcode/<project>/.gf/gfcode/Layer arbitration: builtin → user → project, same-name override; project
.gf/gfcodededuped when it is also the builtin dir.Changes
*load-path*, imports viaenvironment, fetchesextension, passesctxbased on factory arity..gf/gfcodetrees, returns(type/name/root/path)descriptors; builtin dir derived from.gfentries in*load-path*(PI_BUILTIN_EXTENSIONS_DIRstill overrides).<root>/gfcode/<name>.scm(repo must contain<name>.scm).(gfcode ...)libraries exportingextension; removed oldextensions/,.gf/extensions/, legacy plugin tests and fixtures..gf/tests/gfcode/tps-test.scm.gfproject.jsonextensions domain root →.gf/;gf_fmt.jsonupdated.Test plan
gf test(changed since main): 12/12 passgf test code/tests/liii/pi/code/core/extensions/: 128/128 passgf test code/tests/liii/pi/code/cli/args/: 17/17 passgf test code/tests/liii/pi/code/modes/: 22/22 passgf fmt --check --changed-since=main: clean